package org.jgs1904.oopbase.test.nestedclass.innerclass;

/**
 * @author: 默苍璃
 * @date: 2022-09-14 17:06
 * <p>
 * 普通匿名类
 */
public class Outer {

    //私有属性
    private String name;

    //有参构造方法
    Outer(String name) {
        Inner inner = new Inner();
        inner.hello();
        this.name = name;
    }

    //内部类 Inner
   protected class Inner {
        //hello 方法
        void hello() {
            System.out.println("Hello, " + Outer.this.name);
        }
    }

}
